home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld: Complete Mac Interactive
/
Macworld Complete Mac Interactive CD)(1994).iso
/
Software
/
More Shareware⁄Freeware
/
NIH Image 1.55 f (non fpu)
/
Macros
/
PidNumber Demo
< prev
next >
Wrap
Text File
|
1993-11-24
|
2KB
|
111 lines
{Macros which illustrate the use of picNumber, pidNumber, }
{SelectPic, and SelectWindow. }
var
line: integer;
myPicNumber: integer;
myPidNumber: integer;
macro 'Create some images… [A]';
var
howMany: integer;
i: integer;
begin
SetBackgroundColor(0);
SetForegroundColor(255);
howMany := GetNumber('How many images do you want?',5);
while nPics < howMany do begin
MakeNewWindow('new image');
SetPicName('PicNum=',PicNumber:0,', PidNum=',PidNumber:0);
end;
line := 1;
for i := 1 to nPics do begin
SelectPic(i);
MoveTo(10,15*line);
Write('PicNumber = ',picNumber:1,', PidNumber = ',
pidNumber:1);
end;
end;
macro 'SelectPic… [B]';
var
id: integer;
begin
id := GetNumber('(+) pic number or (-) pic ID to select',-1);
SelectPic(id);
end;
macro 'Draw PicNumber and PidNumber in each image [C]';
var
i: integer;
begin
SetBackgroundColor(0);
SetForegroundColor(255);
line := line + 1;
for i := 1 to nPics do begin
SelectPic(i);
MoveTo(10,15*line);
Write('PicNumber = ',picNumber:1,
', PidNumber = ',pidNumber:1);
end;
end;
macro 'Dispose of the front image [D]';
begin
Dispose;
end;
macro 'Dispose All [E]';
begin
DisposeAll;
end;
macro 'This is my favorite image [F]';
begin
myPicNumber := PicNumber;
myPidNumber := PidNumber;
line := line + 1;
MoveTo(10,15*line);
Write('Favorite: PicNumber = ',picNumber:1,
', PidNumber =',pidNumber:1);
SetPicName('My Favorite Image');
end;
macro 'Try to find my favorite image by PicNumber [G]';
begin
SelectPic(myPicNumber);
end;
macro 'Try to find my favorite image by PidNumber [H]';
begin
if PidExists(myPidNumber)
then SelectPic(myPidNumber)
else PutMessage('Image is no longer open');
end;
macro 'Try to find my favorite image by window title [I]'
begin
SelectWindow('My Favorite Image');
end;
macro 'Pick an image, any image [P]';
begin
SelectPic(trunc(random * nPics) + 1);
end;
macro 'Erase all Images [Q]';
var
i: integer;
begin
SetBackgroundColor(0);
for i := 1 to nPics do begin
SelectPic(i);
SelectAll;
Clear;
end;
KillRoi;
line:=0;
end;